#pragma once

#include <QtWidgets/QWidget>
#include "ui_SCPlayer.h"
#include <QTime>
#include <QMutex>

class Direct3DXCanvas;
class AudioPlay;
class Player;

struct StreamsParameters;
class SCPlayer : public QWidget
{
	Q_OBJECT

public:
	SCPlayer(QWidget *parent = Q_NULLPTR);
	~SCPlayer();

private:

	QString ConvertToTime(int ms, bool accurate);

private slots:
	void timeout();

private:
	Ui::SCPlayerClass ui;

public:
signals:
	void PlayerQuit_Signal(int index, QPushButton* btn);

private:
	void PlayerButtonClicked(int index, QPushButton* btn);

private slots:

	void on_PlayerButton1_clicked() { PlayerButtonClicked(0, ui.PlayerButton1); }

	void on_PlayerButton2_clicked() { PlayerButtonClicked(1, ui.PlayerButton2); }

	void on_PlayerButton3_clicked() { PlayerButtonClicked(2, ui.PlayerButton3); };

	void closeEvent(QCloseEvent *event);

	void PlayerQuit(int index, QPushButton* btn) { PlayerButtonClicked(index, btn); }

private:
	Player* players[3] = { 0 };
};
